import 'package:flutter/material.dart';

class Test001 extends StatefulWidget {
  const Test001({super.key});

  @override
  State<Test001> createState() => _Test001State();
}

class _Test001State extends State<Test001> {
  double height = 100;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("动画1"),
      ),
      body: Column(
        children: [
          OutlinedButton(
              onPressed: () {
                setState(() {
                  height += 100;
                  if (height > 600) {
                    height = 100;
                  }
                });
              },
              child: const Text("+")),
          AnimatedContainer(
            duration: const Duration(milliseconds: 500),
            height: height,
            width: 200,
            color: Colors.red,
            child: const Center(
              child: Text(
                "测试",
                style: TextStyle(fontSize: 24),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
